
// Shape.cpp: implementation of the Shape class.
//
//////////////////////////////////////////////////////////////////////

#include "Shape.h"
#include "math.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

bool isLess(double input, double boundary)
{
	return (input < boundary);
}
bool isLessOrEqual(double input, double boundary)
{
	return (input <= boundary);
}
bool isGreat(double input, double boundary)
{
	return (input > boundary);
}
bool isGreatOrEqual(double input, double boundary)
{
	return (input >= boundary);
}

bool checkInputValid(double input, double boundary, compareFunc comp)
{
	return(comp(input, boundary));
}

double getFloorOfValue(double input, int precision)
{
    int temp = static_cast<int>(input * pow(10, precision));
	return (static_cast<double>(temp))/pow(10, precision);
}

double getRoundOfValue(double input, int precision)
{
	double temp = getFloorOfValue(input, precision);
	return ((input -temp) < pow(0.1, precision)/2) ? temp : (temp + pow(0.1, precision));
}
